package com.fr.base.core.antlr;

import com.fr.base.core.antlr.collections.impl.BitSet;

class CharRangeElement extends AlternativeElement
{
  String label;
  protected char begin = ';
  protected char end = ';
  protected String beginText;
  protected String endText;

  public CharRangeElement(LexerGrammar paramLexerGrammar, Token paramToken1, Token paramToken2, int paramInt)
  {
    super(paramLexerGrammar);
    this.begin = (char)ANTLRLexer.tokenTypeForCharLiteral(paramToken1.getText());
    this.beginText = paramToken1.getText();
    this.end = (char)ANTLRLexer.tokenTypeForCharLiteral(paramToken2.getText());
    this.endText = paramToken2.getText();
    this.line = paramToken1.getLine();
    for (int i = this.begin; i <= this.end; ++i)
      paramLexerGrammar.charVocabulary.add(i);
    this.autoGenType = paramInt;
  }

  public void generate()
  {
    this.grammar.generator.gen(this);
  }

  public String getLabel()
  {
    return this.label;
  }

  public Lookahead look(int paramInt)
  {
    return this.grammar.theLLkAnalyzer.look(paramInt, this);
  }

  public void setLabel(String paramString)
  {
    this.label = paramString;
  }

  public String toString()
  {
    if (this.label != null)
      return " " + this.label + ":" + this.beginText + ".." + this.endText;
    return " " + this.beginText + ".." + this.endText;
  }
}